package leedcode;

import java.util.ArrayList;
import java.util.Arrays;

public class q1 {
    public static void main(String[] args) {
        Solution1 solution1 = new Solution1();
        int[] nums = new int[]{2,7,11,15};
        int target = 9;
        System.out.println(Arrays.toString(solution1.twoSum(nums, target)));
    }

}

class Solution1 {
    public int[] twoSum(int[] nums, int target) {
        for(int i=0;i<nums.length;i++){
            for(int j =i+1 ;j<nums.length;j++){
                int n = target-nums[i];
                if(nums[j] == n){
                    return new int[]{i,j};
                }
            }
        }
        return new int[]{0};
    }
}


